package sl.cvs.dao.impl;

import org.mybatis.spring.SqlSessionTemplate;
import sl.cvs.dao.sysUser.SysUserMapper;
import sl.cvs.pojo.SysUser;

import java.util.List;

/**
 * 用户数据层实现
 */
public class SysUserMapperImpl implements SysUserMapper {

    private SqlSessionTemplate sqlSession;

    //查询用户列表
    @Override
    public List<SysUser> selectSysUserList(SysUser sysUser) {
        return sqlSession.selectList("sl.cvs.dao.sysUser.SysUserMapper.selectSysUserList",sysUser);
    }

    /**
     * 保存用户
     *
     * @param sysUser
     * @return
     */
    @Override
    public int add(SysUser sysUser) {
        return sqlSession.update("sl.cvs.dao.sysUser.SysUserMapper.add",sysUser);
    }

    public SqlSessionTemplate getSqlSession() {
        return sqlSession;
    }

    public void setSqlSession(SqlSessionTemplate sqlSession) {
        this.sqlSession = sqlSession;
    }

}
